﻿using System.ComponentModel;
using SAPPDI.Entitys;
using TestImpresion.Annotations;

namespace TestImpresion.Clases
{
    public class ComparPorFormulario : INotifyPropertyChanged
    {

        private double _costoPliegos;

        private double _costoImpresion;

        public double CostoPliegos
        {
            get { return _costoPliegos; }
            set
            {
                this._costoPliegos = value;
                NotifyPropertyChanged("CostoPliegos");
            }
        }

        public double CostoImpresion
        {
            get { return this._costoImpresion; }
            set
            {
                this._costoImpresion = value;
                NotifyPropertyChanged("CostoImpresion");
            }
        }

        private Pliego _pliego;

        public Pliego PliegoSeleccionado
        {
            get { return this._pliego; }
            set
            {
                _pliego = value;
                NotifyPropertyChanged("PliegoSeleccionado");
            }
        }

        public ComparPorFormulario()
        {
            this._pliego= new Pliego(1,1);           
        }

        public ComparPorFormulario(ComparPorFormulario elemento)
        {
            this._costoImpresion = elemento.CostoImpresion;
            this._costoPliegos = elemento.CostoPliegos;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void NotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}
